package com.csg.service.impl;

import com.csg.entity.SysUser;
import com.csg.mapper.SysUserMapper;
import com.csg.service.ISysUserService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 系统用户表 服务实现类
 * </p>
 *
 * @author George Chan
 * @since 2020-02-06
 */
@Service
public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> implements ISysUserService {

    @Override
    public PageInfo<SysUser> findUserListPage(String query, int pagenum, int pagesize) {
        PageHelper.startPage(pagenum, pagesize, true);
        List<SysUser> userList = this.baseMapper.listUserDataPage(query);
        PageInfo<SysUser> pageInfo = new PageInfo<>(userList);
        return pageInfo;
    }
}
